<?php



namespace app\api\validate;


use \think\Validate;

/**
 *  注册验证类
 */
class Register extends Validate
{
    protected $rule = [
        'cusname' => 'require',
        'email' => 'require|email',
        'password' => 'require|length:16,32',
        'code' => 'require|length:6',

    ];

    //定义验证提示
    protected $message = [
        'cusname.require' => 'register.cusnameCannotBeEmpty',
        'email.require' => 'register.emailCannotBeEmpty',
        'email.email' => 'register.emailFormatError',
        'password.require' => 'register.passwordRequire',
        'password.length' => 'register.passwordLength',
        'code.require' => 'register.codeRequire',
        'code.length' => 'register.codeLength',
    ];

    //定义验证场景
    protected $scene = [
        'register' => ['email','password'],
    ];
}
